<script setup>
import { toRefs } from "vue";
import {useStore} from "vuex"

const {state,commit} = useStore()

const {count} = toRefs(state)
const add = () => {
    commit("increment")
}
</script>

<template>
    <h2>{{count}}</h2>
    <button @click="add">增加</button>
</template>

